import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Microsoft
 * Date: 2022-11-09
 * Time: 17:04
 */
public class Test {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int count = 0;
        //判断n有几个二进制的1
        while (n != 0) {
            n = n & (n - 1);
            count++;
        }
        System.out.println(count);
    }


    public static void main10(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int count = 0;
        //判断n有几个二进制的1
        for (int i = 0; i < 32; i++) {
            if (((n >>> i) & 1) == 1) {
                count++;
            }
            if((n >>> i) == 0) {
                break;
            }
        }
        System.out.println(count);
    }


    public static void main9(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        for (int i = 1; i <= num ; i++) {
            //判断1-num中谁是自幂数
            //判断i是否为自幂数
            //1首先获得i是几位数字
            int count = 0;
            int tmp = i;
            while (tmp != 0 ) {
                count++;
                tmp /= 10;
            }
            //count即为数字位数
            tmp = i;
            int sum = 0;
            while (tmp != 0) {
                sum += Math.pow(tmp % 10,count);
                tmp /= 10;
            }
            //sum即为数字幂次和
            //进行判断
            if (sum == i) {
                System.out.println(i);
            }
        }
    }


    public static void main8(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = a % b;
        while (c != 0) {
            a = b;
            b = c;
            c = a % b;
        }
        System.out.println(b);
    }


    public static void main7(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        for (int i = 1; i <= n ; i++) {
            //行
            for (int j = 1; j <= i ; j++) {
                System.out.print(i+"*"+j+"="+(i*j)+" ");
            }
            System.out.println();
        }
    }



    public static void main6(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();

        for (int n = 2; n <= num ; n++) {
            //判断n是否为素数
            int i = 2;
            for (; i <= Math.sqrt(n) ; i++) {
                if(n % i == 0) {
                    break;
                }
            }
            if(i > Math.sqrt(n)) {
                System.out.println(n + "是素数");
            }else {
                System.out.println(n + "不是素数");
            }
        }

    }




    public static void main5(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int i = 2;
        for (; i <= Math.sqrt(n) ; i++) {
            if(n % i == 0) {
                break;
            }
        }
        if(i >= Math.sqrt(n)) {
            System.out.println(n + "是素数");
        }else {
            System.out.println(n + "不是素数");
        }
    }






    public static void main4(String[] args) {
        //判断是否为素数
        int n = 100;
        int flag = 1;
        for (int i = 2; i < n ; i++) {

            if(n % i == 0) {
                flag = 0;
                break;
            }
        }
        if(flag == 1) {
            System.out.println(n + "是素数");
        }else {
            System.out.println(n + "不是素数");
        }
    }



    public static void main3(String[] args) {
        for (int i = 1000; i <= 2000 ; i++) {
            //判断i是否为闰年
            if((i % 400 == 0) || (i % 4 == 0 && i % 100 != 0)) {
                System.out.println(i);
            }

        }
    }




    public static void main2(String[] args) {
        int count = 0;

        for (int i = 1; i <= 100; i++) {
            if (i % 10 == 9) {
                count++;
            }
            if (i / 10 == 9) {
                count++;
            }
        }
        System.out.println(count);
    }
    //9 19 29 39 49 59 69 79 89
    //90 91 92 93 94 95 96 97 98 99


    public static void main1(String[] args) {
        int i = 1;
        while(i <= 100) {
            //判断i是否为素数
            int j = 2;
            int flag = 1;
            while (j < i) {
                if(i % j == 0) {
                    flag = 0;
                    break;
                }
                j++;
            }
            if (flag == 1) {
                //是素数
                System.out.println(i);
            }else {
                i++;
                continue;
            }
            i++;
        }
    }
}
